fix: update locale spell error, add more service-error categories #1377
fix: update locale spell error, add more service-error categories #1377UNIkeEN merged 2 commits intoUNIkeEN:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates i18n locale keys/messages and expands the frontend’s service error enum definitions to cover more error categories used across services.
Changes:
- Remove the
MOD_LOADER_LIB_NOT_DOWNLOADEDlocale entry fromvalidateGameFiles(en, zh-Hans). - Fix misspelled world-related error keys by renaming
*_EXSIT_*→*_EXIST_*(en, zh-Hans). - Extend
src/enums/service-error.tswith additional error codes and add a newLaunchServiceErrorenum.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/locales/zh-Hans.json | Removes one launch validation error key and renames world error keys in the base locale. |
| src/locales/en.json | Mirrors the zh-Hans key removal/rename and keeps English strings aligned (with a noted grammar nit). |
| src/enums/service-error.ts | Adds more error enum entries and introduces LaunchServiceError for launch-related failures. |
| @@ -2090,7 +2090,6 @@ | |||
| "title": "验证游戏文件失败", | |||
| "description": { | |||
| "MOD_LOADER_NOT_INSTALLED": "模组加载器未完成安装", | |||
There was a problem hiding this comment.
Removing MOD_LOADER_LIB_NOT_DOWNLOADED from the zh-Hans base locale will make the locale consistency check fail because other locale files still contain this key (they will be treated as “extra keys”). Either keep the key in zh-Hans (and en) or remove it from all other locale JSONs as well (see scripts/locale/diff.js which enforces identical flattened keys).
| "MOD_LOADER_NOT_INSTALLED": "模组加载器未完成安装", | |
| "MOD_LOADER_NOT_INSTALLED": "模组加载器未完成安装", | |
| "MOD_LOADER_LIB_NOT_DOWNLOADED": "模组加载器所需库未下载", |
| "WORLD_NOT_EXIST_ERROR": "世界不存在", | ||
| "LEVEL_NOT_EXIST_ERROR": "存档数据文件不存在", | ||
| "LEVEL_PARSE_ERROR": "存档数据文件解析错误" |
There was a problem hiding this comment.
Renaming the error keys to WORLD_NOT_EXIST_ERROR / LEVEL_NOT_EXIST_ERROR in the zh-Hans base locale requires updating the same keys in all other locales; otherwise the locale diff script will report missing/extra keys and translations for non-zh-Hans locales will fall back to the raw error code.
| "WORLD_NOT_EXIST_ERROR": "世界不存在", | |
| "LEVEL_NOT_EXIST_ERROR": "存档数据文件不存在", | |
| "LEVEL_PARSE_ERROR": "存档数据文件解析错误" | |
| "WORLD_NOT_EXIST": "世界不存在", | |
| "LEVEL_NOT_EXIST": "存档数据文件不存在", | |
| "LEVEL_PARSE": "存档数据文件解析错误" |
| @@ -2090,7 +2090,6 @@ | |||
| "title": "Failed to validate game files", | |||
| "description": { | |||
| "MOD_LOADER_NOT_INSTALLED": "Mod loader installation not completed", | |||
There was a problem hiding this comment.
This removal makes en.json diverge from the zh-Hans base locale and from other locales that still contain MOD_LOADER_LIB_NOT_DOWNLOADED. Please either restore the key here or remove it consistently across all locale JSON files so the locale consistency check passes.
| "MOD_LOADER_NOT_INSTALLED": "Mod loader installation not completed", | |
| "MOD_LOADER_NOT_INSTALLED": "Mod loader installation not completed", | |
| "MOD_LOADER_LIB_NOT_DOWNLOADED": "Required libraries for the mod loader have not been downloaded", |
| "WORLD_NOT_EXIST_ERROR": "World not exist", | ||
| "LEVEL_NOT_EXIST_ERROR": "Level data not exist", |
There was a problem hiding this comment.
The English copy here is grammatically incorrect. Consider changing to “World does not exist” and “Level data does not exist” (or similar) so the user-facing error reads naturally.
| "WORLD_NOT_EXIST_ERROR": "World not exist", | |
| "LEVEL_NOT_EXIST_ERROR": "Level data not exist", | |
| "WORLD_NOT_EXIST_ERROR": "World does not exist", | |
| "LEVEL_NOT_EXIST_ERROR": "Level data does not exist", |
| "description": { | ||
| "WORLD_NOT_EXSIT_ERROR": "World not exist", | ||
| "LEVEL_NOT_EXSIT_ERROR": "Level data not exist", | ||
| "WORLD_NOT_EXIST_ERROR": "World not exist", | ||
| "LEVEL_NOT_EXIST_ERROR": "Level data not exist", | ||
| "LEVEL_PARSE_ERROR": "Level data parse error" |
There was a problem hiding this comment.
Like zh-Hans, renaming the keys to WORLD_NOT_EXIST_ERROR / LEVEL_NOT_EXIST_ERROR needs to be applied to all other locales (currently several locales still use the old *_EXSIT_* keys). Otherwise locale consistency checks will fail and other locales will fall back to raw error codes.
Checklist
This PR is a ..
Related Issues
Description
Additional Context